<HTML>
<HEAD>
<title>Atomic.Var - </title>
<link rel="stylesheet" href="../../../style.css">
</HEAD>
<BODY>
<a href="../../index.html">org.mapdb</a>&nbsp;/&nbsp;<a href="../index.html">Atomic</a>&nbsp;/&nbsp;<a href=".">Var</a><br/>
<br/>
<h1>Var</h1>
<code><span class="keyword">class </span><span class="identifier">Var</span><span class="symbol">&lt;</span><span class="identifier">E</span>&nbsp;<span class="symbol">:</span>&nbsp;<span class="identifier">Any</span><span class="symbol">&gt;</span></code><br/>
<p>Atomically updated variable which may contain any type of record. </p>
<br/>
<br/>
<h3>Constructors</h3>
<table>
<tbody>
<tr>
<td>
<a href="-init-.html">&lt;init&gt;</a></td>
<td>
<code><span class="identifier">Var</span><span class="symbol">(</span><span class="identifier" id="org.mapdb.Atomic.Var$<init>(org.mapdb.Store, kotlin.Long, org.mapdb.Serializer((org.mapdb.Atomic.Var.E)))/store">store</span><span class="symbol">:</span>&nbsp;<a href="../../-store/index.html"><span class="identifier">Store</span></a><span class="symbol">, </span><span class="identifier" id="org.mapdb.Atomic.Var$<init>(org.mapdb.Store, kotlin.Long, org.mapdb.Serializer((org.mapdb.Atomic.Var.E)))/recid">recid</span><span class="symbol">:</span>&nbsp;<span class="identifier">Long</span><span class="symbol">, </span><span class="identifier" id="org.mapdb.Atomic.Var$<init>(org.mapdb.Store, kotlin.Long, org.mapdb.Serializer((org.mapdb.Atomic.Var.E)))/serializer">serializer</span><span class="symbol">:</span>&nbsp;<a href="../../-serializer/index.html"><span class="identifier">Serializer</span></a><span class="symbol">&lt;</span><span class="identifier">E</span><span class="symbol">&gt;</span><span class="symbol">)</span></code></td>
</tr>
</tbody>
</table>
<h3>Functions</h3>
<table>
<tbody>
<tr>
<td>
<a href="compare-and-set.html">compareAndSet</a></td>
<td>
<code><span class="keyword">fun </span><span class="identifier">compareAndSet</span><span class="symbol">(</span><span class="identifier" id="org.mapdb.Atomic.Var$compareAndSet(org.mapdb.Atomic.Var.E, org.mapdb.Atomic.Var.E)/expect">expect</span><span class="symbol">:</span>&nbsp;<span class="identifier">E</span><span class="symbol">, </span><span class="identifier" id="org.mapdb.Atomic.Var$compareAndSet(org.mapdb.Atomic.Var.E, org.mapdb.Atomic.Var.E)/update">update</span><span class="symbol">:</span>&nbsp;<span class="identifier">E</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code><p>Atomically sets the value to the given updated value if the current value equals the expected value. </p>
</td>
</tr>
<tr>
<td>
<a href="get.html">get</a></td>
<td>
<code><span class="keyword">fun </span><span class="identifier">get</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">E</span></code><p>Returns the current value. </p>
</td>
</tr>
<tr>
<td>
<a href="get-and-set.html">getAndSet</a></td>
<td>
<code><span class="keyword">fun </span><span class="identifier">getAndSet</span><span class="symbol">(</span><span class="identifier" id="org.mapdb.Atomic.Var$getAndSet(org.mapdb.Atomic.Var.E)/newValue">newValue</span><span class="symbol">:</span>&nbsp;<span class="identifier">E</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">E</span></code><p>Atomically sets to the given value and returns the previous value. </p>
</td>
</tr>
<tr>
<td>
<a href="get-recid.html">getRecid</a></td>
<td>
<code><span class="keyword">fun </span><span class="identifier">getRecid</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Long</span></code><p></p>
</td>
</tr>
<tr>
<td>
<a href="set.html">set</a></td>
<td>
<code><span class="keyword">fun </span><span class="identifier">set</span><span class="symbol">(</span><span class="identifier" id="org.mapdb.Atomic.Var$set(org.mapdb.Atomic.Var.E)/newValue">newValue</span><span class="symbol">:</span>&nbsp;<span class="identifier">E</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Unconditionally sets to the given value. </p>
</td>
</tr>
<tr>
<td>
<a href="to-string.html">toString</a></td>
<td>
<code><span class="keyword">fun </span><span class="identifier">toString</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">String</span></code></td>
</tr>
</tbody>
</table>
</BODY>
</HTML>
